package cn.ljq.service;

import cn.ljq.dao.UserMapper;
import cn.ljq.entity.Task;
import cn.ljq.entity.User;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public int add(User u) {
        return userMapper.add(u);
    }

    @Override
    public int update(User u) {
        return userMapper.update(u);
    }

    @Override
    public int updatePwd(User u) {
        return userMapper.updatePwd(u);
    }

    @Override
    public User findById(int uid) {
        return userMapper.findById(uid);
    }

    @Override
    public List<User> findByRole(String role) {
        return userMapper.findByRole(role);
    }

    @Override
    public User findByPhone(String phone) {
        return userMapper.findByPhone(phone);
    }

    @Override
    public int del(int uid) {
        return userMapper.del(uid);
    }

    @Override
    public List<User> findPage(int n1, int n2, String role) {
        return userMapper.findPage(n1,n2,role);
    }

    @Override
    public Integer getTotal(String role) {
        return userMapper.getTotal(role);
    }

    @Override
    public List<Task> findMyCourse(String clzno) {
        return userMapper.findMyCourse(clzno);
    }

    @Override
    public List<User> findStuByClz(String clzno) {
        return userMapper.findStuByClz(clzno);
    }
}
